<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: gray;
        }

        .account {
            width: 400px;
            margin: 50px auto;
            padding: 20px;
            background-color: aliceblue;
            border-radius: 20px;
        }
    </style>
</head>
<body>
    <div class="account">
        <h1 style="text-align: center;font-weight: bold">注册</h1>
        <form>
            {% for field in form %}
                {% if field.name == 'code' %}
                    <div class="form-group">
                        <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                        <div class="clearfix">
                            <div class="col-md-6" style="padding-left: 0">{{ field }}</div>
                            <div class="col-md-6"><input type="button" value="点击获取验证码" class="btn btn-default"/></div>
                        </div>
                    </div>
                {% else %}
                    <div class="form-group">
                        <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                        {{ field }}
                    </div>
                {% endif %}
            {% endfor %}
            <button type="submit" class="btn btn-primary" style="width: 100%">注 册</button>
        </form>
    </div>
</body>
</html>